using System;
using System.Collections;
using Unity.Mathematics;
using UnityEngine;

public class Kid : Obstacle
{
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    bool isAttack;
    public float attackRange,height;
    public GameObject stone,upHand,lowHand;
    
    void Start()
    {
        
    }
    public virtual void Create()
    {
        upHand.SetActive(true);
        GameObject item=Instantiate(stone);
        item.transform.SetParent(transform);
        item.transform.localPosition=transform.position+Vector3.up*height;
        lowHand.SetActive(false);
    }
    // Update is called once per frame
    void Update()
    {
        if(transform.position.x-Bubble.I.transform.position.x<attackRange && !isAttack)
        {
            isAttack=true;
            //am.SetBool("isAttack",true);
            Create();
        }
        base.Update();
    }
}
